﻿using NUnit.Framework;
using System.Collections.Generic;
using OpenSda.Agilcont.Common.Data.Contracts;
using OpenSda.Agilcont.Common.Data.Entities;

namespace OpenSda.Agilcont.Common.Data.NhContexts.NuTest
{

    [TestFixture]
    public class AgenciaDataTest : AbstractBaseDataTests
    {
        private IAgenciaData target;
        private IEmpresaData empresaData;

        // These properties will be injected based on type
        public IAgenciaData AgenciaData { set { target = value; } }
        public IEmpresaData EmpresaData { set { empresaData = value; } }


        [Test]
        public void SaveTest()
        {
            Agencia agencia = this.Save();
            Assert.IsNotNull(agencia.Identity);
        }

        private Agencia Save()
        {
            Empresa e = empresaData.GetAll()[0];

            return target.Save(new Agencia()
            {
                Codigo = "5",
                NombreComun = "UPeu Juliaca",
                EmpresaRef = e
                //BirthDate = new DateTime(1977, 01, 12)
            });
        }


    }
}
